function refresh() 
{    
	document.getElementById('results').innerHTML="Loading..."
	document.getElementById('time').innerHTML="";
      var params = {};  
      params[gadgets.io.RequestParameters.CONTENT_TYPE] = gadgets.io.ContentType.TEXT;  
      var url = "http://earl1.appspot.com/main";  
      gadgets.io.makeRequest(url, response, params);
}

function response(obj) 
{ 
	var str, sec, text, i;
	
	str = obj.text;
	text = "";
	sec = parseForTime(str);
	i = str.indexOf("|");
	text = str.substring(0, i);

	document.getElementById('results').innerHTML="";
	document.getElementById('time').innerHTML="";
	document.getElementById('results').innerHTML = text;
	document.getElementById('time').innerHTML = sec;
}

function parseForTime(str)
{
	var i, j, temp;

	temp = "";
	i = str.indexOf("|", 0);
	if(i != -1)
	{
		for(j = i; j < str.length - 1; j++)
			temp = temp + str.charAt(j);
	}

	return temp;
}

			
